package com.ga.controller;

import com.ga.model.User;
import com.ga.util.DBUtil;
import com.jfinal.aop.Before;
import com.jfinal.aop.ClearInterceptor;
import com.jfinal.aop.ClearLayer;
import com.jfinal.core.ActionKey;
import com.jfinal.core.Controller;
public class BmIndexController extends Controller {
	
	public void index(){
		render("bm/login.html");
	}
	// home render
	@ActionKey("/bm/home")
	public void home() {
		render("bm/home.html");
	}
	
	@ActionKey("/bm/home/init")
	public void homeinit() {
		User user = (User) this.getSessionAttr("user");
		renderJson(user);
	}

	// users render
	@ActionKey("/bm/users/list")
	public void userlist() {
		render("bm/users/list.html");
	}
	
	// album render
	@ActionKey("/bm/album/list")
	public void albumlist() {
		render("bm/album/list.html");
	}
	
	// video render
	@ActionKey("/bm/video/list")
	public void video() {
		render("bm/video/list.html");
	}
	
	// video render
	@ActionKey("/bm/reply/list")
	public void reply() {
		render("bm/reply/list.html");
	}

	// commons
	@ActionKey("/bm/main")
	public void main() {
		render("bm/main.html");
	}

	@ActionKey("/bm/gapi")
	public void gapi() {
		render("bm/gapi.html");
	}

	@ActionKey("/bm/datainit")
	public void datainit() {
		try {
			DBUtil.datainit();
			renderText("1");
		} catch (Exception e) {
			renderText("0");
			e.printStackTrace();
		}
	}

	@ActionKey("/upload")
	public void upload() {
		

	}
public static void main(String[] args) {
	System.out.println(1024*1024*300);
}
}
